package com.yc.happ.serviceImpl;

import com.yc.happ.entity.Elder;
import com.yc.happ.service.ElderService;
import com.yc.happ.util.DBHelper;
public class ElderServiceImpl implements ElderService {

	public static Integer count=10005;
	@Override
	public boolean register(Elder vol) {
		boolean flag = true;
		vol.setVid(count++);
		vol.setIsChoose(0);
		try {
			flag = DBHelper.save(vol) > 0;
		} catch (Exception e) {
			flag = false;
		}
		return flag;
	}
	@Override
	public Elder login(Elder vol) {
		try {
			vol = DBHelper.query(vol);
		} catch (Exception e) {
			vol = null;
		}
		return vol;
	}
}
